#include "adm_opengl_es20.h"
#include <cmath>
#include <cstring>
using namespace std;
using namespace Andromeda;

Shader glCreateShader(shaderType shader) {
  Shader res;
  if (shader == GL_VERTEX_SHADER) {
    res = VertexShader;
  } else if ( shader == GL_FRAGMENT_SHADER) {
    res = FragmentShader;
  }
}

void glShaderSource(Shader shader, string shader_code){
  cout<<"Shader name:"<<shader.getName()<<" is loading the code :\n"<<shader_code<<endl;
}

bool glCompileShader(Shader shader){
  return shader.getCompile();
}

bool glAttachShader(Shader shader) {
  return shader.getAttach();
}

vec3 normalize(const vec3& rhs){
  vec3 res;
  float pow_sum;
  pow_sum = 0.0;
  for (int i=0; i<3; i++) {
    pow_sum + = rhs[i]*rhs[i];
  }
  pow_sum = sqrt(pow_sum);

  for (int i=0; i<3; i++) {
    res[i] = res[i] / pow_sum;
  }
  return res;

}

